package org.deschutter.hibernate;

import javax.persistence.*;

/**
 * User: Berten De Schutter
 * Date: 01-Oct-2009
 * Time: 13:40:05
 */
@Entity
@Table(catalog = "scimitar", name = "scan_user")
public class ScanUser {
    private int id;

    @Id
    @Column(name = "ID")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ScanUser scanUser = (ScanUser) o;

        if (id != scanUser.id) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id;
    }

    private Scans scansByScanId;

    @ManyToOne
    @JoinColumn(name = "scan_id", referencedColumnName = "ID", nullable = false)
    public Scans getScansByScanId() {
        return scansByScanId;
    }

    public void setScansByScanId(Scans scansByScanId) {
        this.scansByScanId = scansByScanId;
    }

    private User userByUserId;

    @ManyToOne
    @JoinColumn(name = "user_id", referencedColumnName = "ID", nullable = false)
    public User getUserByUserId() {
        return userByUserId;
    }

    public void setUserByUserId(User userByUserId) {
        this.userByUserId = userByUserId;
    }
}
